hysop.backend.host.python.operator.poisson_curl module

class hysop.backend.host.python.operator.poisson_curl.PythonPoissonCurl(vorticity, velocity, variables, diffusion=None, dt=None, projection=None, **kwds)[source]

Bases: SpectralPoissonCurlOperatorBase, OpenClMappable, HostOperator

Solves the poisson rotational equation using numpy fftw.

PoissonCurl operator to solve incompressible flows using various fft backends.

Parameters:
  • velocity (:class:`~hysop.fields.continuous_field.Field) – Output solution velocity field.

  • vorticity (Field) – Input vorticity to be diffused, projected. If diffused and/or projected, vorticity is also an output.

  • variables (dict) – Dictionary of Fields as keys and topologies as values.

  • diffusion (ScalarParameter, optional, defaults to None.) – Diffuse the vorticity field before applying projection and poisson velocity.

  • dt (ScalarParameter, optional, defaults to None) – Timestep is only required for diffusion. If diffusion is not enabled, this parameter is ignored.

  • projection (hysop.constants.FieldProjection or positive integer, optional) – Project vorticity such that resolved velocity is divergence free (for 3D fields). When active, projection is done prior to every solve, unless projection is an integer in which case it is done every given steps. This parameter is ignored for 2D fields and defaults to no projection.

  • dump_energy (IOParams, optional, defaults to None) – Will set the default io parameter for all energy plotters.

  • dump_velocity_energy (IOParams, optional, defaults to None) – Dump velocity field energy to a custom file. Defaults to no dump.

  • dump_input_vorticity_energy (IOParams, optional, defaults to None) – Dump input vorticity field energy to a custom file. Defaults to no dump.

  • dump_output_vorticity_energy (IOParams, optional, defaults to None) – Dump output vorticity field energy to a custom file. Defaults to no dump.

  • plot_energy (IOParams, optional, defaults to None) – Will set the default io parameter for all energy plotters.

  • plot_velocity_energy (IOParams, optional, defaults to None) – Plot velocity field energy and save the plot to a custom file. Defaults to no plot.

  • plot_input_vorticity_energy (IOParams, optional, defaults to None) – Plot input vorticity field energy and save the plot to a custom file. Defaults to no plot.

  • plot_output_vorticity_energy (IOParams, optional, defaults to None) – Plot output vorticity field energy and save the plot to a custom file. Defaults to no plot.

  • plot_inout_vorticity_energy (IOParams, optional, defaults to None) – Plot vorticity field energy before and after diffusion and projection on the same graph.

  • kwds – Base class parameters.

  • Notes

  • ------

  • dumping. (All dump energy arguments also enables scalar energy)

  • plotting. (This is not true for energy)

  • arguments. (Passing an integer instead of a IOParams will disable dump and plot)

apply(**kwds)

Abstract method that should be implemented. Applies this node (operator, computational graph operator…).

classmethod build_filter_curl_2d__0_m(FIN, K, FOUT, target='parallel')[source]
classmethod build_filter_curl_2d__1_n(FIN, K, FOUT, target='parallel')[source]
classmethod build_filter_curl_3d__0_m(FIN, K, FOUT, target='parallel')[source]
classmethod build_filter_curl_3d__0_n(FIN, K, FOUT, target='parallel')[source]
classmethod build_filter_curl_3d__0_p(FIN, K, FOUT, target='parallel')[source]
classmethod build_filter_curl_3d__1_m(FIN, K, FOUT, target='parallel')[source]
classmethod build_filter_curl_3d__1_n(FIN, K, FOUT, target='parallel')[source]
classmethod build_filter_curl_3d__1_p(FIN, K, FOUT, target='parallel')[source]
setup(work)[source]

Setup temporary buffer that have been requested in get_work_properties(). This function may be used to execute post allocation routines. This sets self.ready flag to True. Once this flag is set one may call ComputationalGraphNode.apply() and ComputationalGraphNode.finalize().

Automatically honour temporary field memory requests.